home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_psutils.idb / usr / freeware / bin / fixfmps.z / fixfmps
Encoding:
Text File  |  1999-07-16  |  608 b   |  25 lines

  1. #!/usr/freeware/bin/perl
  2. eval 'exec perl -S $0 "$@"'
  3.     if $running_under_some_shell;
  4.  
  5. # fixfmps: get conforming PostScript out of FrameMaker version 2 file
  6. # move all FMDEFINEFONTs to start of pages
  7. #
  8. # Copyright (C) Angus J. C. Duggan 1991-1995
  9. # See file LICENSE for details.
  10.  
  11. %fonts=();
  12.  
  13. while (<>) {
  14.    if (/^([0-9]+) [0-9]+ .* FMDEFINEFONT$/) {
  15.       $fonts{$1} = $_;
  16.    } elsif (/^[0-9.]+ [0-9.]+ [0-9]+ FMBEGINPAGE$/) {
  17.       print $_, join('',values(%fonts));
  18.    } elsif (m%(.*/PageSize \[paperwidth paperheight\]put )setpagedevice(.*)%) {
  19.       print "$1pop$2\n";
  20.    } else {
  21.       print $_;
  22.    }
  23. }
  24.  
  25.